<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${modeTitle }用户</title>
<jsp:include page="../include/edit_meta.jsp"></jsp:include>
</head>
<body>

<div>
    <div class="panel_header">
        <h1>${modeTitle }用户</h1>
    </div>
    <div class="panel_body">
    	<div id="msg"></div>
        <!--表单布局-->
        <form action="${ctx }/user/user!${mode }.shtml" id="edit_form">
        	<input type="hidden" name="id" value="${user.id }" />
	        <div class="form_wrap">
		        <div class="form_item br">
		            <label>用户名称：</label><!--"for"和"id"要对应上-->
		            <input name="user.username" value="${user.username }" type="text" class="input_text required" />
		        </div>
		        <div class="form_item br">
		            <label>用户密码：</label>
		            <input name="user.password" value="${user.password }" class="input_text {required:true,minlength:5}" type="text" />
		        </div>
		        <div class="form_item br">
		            <label>用户姓名：</label>
		            <input name="user.trueName" value="${user.trueName }" class="input_text" type="text" />
		        </div>
		        <div class="form_item br">
		            <label>所属组织：</label>
		            <s:select list="groupList"
				            headerKey=""
				            headerValue="请选择"
							name="user.groupId"
				           	listKey="id"
				           	listValue="name"/>
		        </div>
		        <div class="form_item br">
		            <label>状态：</label>
		            <s:select list="userStateList"
				            headerKey=""
				            headerValue="请选择状态"
							name="user.state"
				           	listKey="code"
				           	listValue="title"/>
		        </div>
		        <div class="divider"></div>
	        	<div class="form_item br">
	        		<label>选择角色：</label>
	        		<s:iterator value="roles">
		        	<input type="checkbox" name="roleIds" ${select } value="${id }"/> ${name }
		        	</s:iterator>
		        </div>
		        <div class="divider"></div>
		    </div>
			    
		    <div class="form_btn">
		        <ul>
		            <li><input type="submit" value="保存" /></li>
		            <li><input type="button" value="取销" onclick="cancel()"/></li>
		        </ul>
		    </div>
	    </form>
        <!--表单布局end-->
    </div>
</div>
</body>
</html>